<template>
  <div><video
    id="my-player"
    class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid"
    preload="auto"
    autoplay
    style="width: 1200px;height: 640px;"
    controls
    data-setup="{}"
  ></video>
  </div>
</template>
<script>
  import videojs from "video.js";
  import "video.js/dist/video-js.css";
  import "videojs-flash";
  export default {
    mounted(){
        alert(111)
        var videoPlayer = videojs(
          "my-player",
          {
            sources: [
              {
                src: "rtmp://47.105.162.57/",
                type: "rtmp/flv"
              }
            ],
            muted: true,
            controls: true,
            autoplay: true,
            loop: true,
            techOrder: ["html5", "flash"],
            width: "1200",
            height: "640"
          },
          function () {
            this.play();
          }
        );
    }
  }
</script>
<!--
<template>
  <div class="markdown">
    <div class="container">
      <mavon-editor v-model="content" ref="md" @imgAdd="$imgAdd" @change="change" style="min-height: 600px"/>
      <button @click="submit">提交</button>
    </div>
  </div>
</template>

<script>
  import { mavonEditor } from 'mavon-editor'
  import 'mavon-editor/dist/css/index.css'
  import axios from 'axios'
  export default {
    name: "",
    props: [],
    components: {
      mavonEditor,
    },
    data() {
      return {
        content:'',
        html:'',
        configs: {}
      }
    },
    methods: {
      // 将图片上传到服务器，返回地址替换到md中
      $imgAdd(pos, $file){
        let formdata = new FormData();
        formdata.append("file",$file)
        axios.post('/abc', formdata).then(res => {
          console.log(res.data);
          this.$refs.md.$img2Url(pos, res.data);
        }).catch(err => {
          console.log(err)
        })
      },
      // 所有操作都会被解析重新渲染
      change(value, render){
        // render 为 markdown 解析后的结果[html]
        this.html = render;
      },
      // 提交
      submit(){
        console.log(this.content);
        console.log(this.html);
        this.$message.success('提交成功，已打印至控制台！');
      }
    },
    mounted() {

    }
  }
</script>
-->
